package dialog;

import java.util.Calendar;

import model.Todo;
import android.app.DatePickerDialog;
import android.app.DatePickerDialog.OnDateSetListener;
import android.content.Context;

public class TodoDateDialog {
	
	private Context context = null;
	private DatePickerDialog dialog = null;
	
	public TodoDateDialog(
			Context context, 
			OnDateSetListener listener) {
		this.context = context;
		
		Calendar cal = Calendar.getInstance();
		dialog = new DatePickerDialog(
				this.context, 
				listener, 
				cal.get(Calendar.YEAR), 
				cal.get(Calendar.MONTH), 
				cal.get(Calendar.DAY_OF_MONTH));
	}
	
	public TodoDateDialog(
			Context context, 
			OnDateSetListener listener, 
			Todo todo) {
		this.context = context;
		
		dialog = new DatePickerDialog(
				this.context, 
				listener, 
				todo.getYear(), 
				todo.getMonth(), 
				todo.getDay());
	}
	
	public void show() {
		dialog.show();
	}
}
